import { Request, Response } from 'express';

export default {
    'GET /mockApi/typeCount': (req: Request, res: Response) => {
        res.send({
            success: true,
            data: [
                {
                    text: '算法模型',
                    value: 10567,
                    color: '#1f3a93',
                    icon: '',
                },
                {
                    text: '论文专著',
                    value: 10567,
                    color: '#9a59b5',
                    icon: '',
                },
                {
                    text: '软件平台',
                    value: 118,
                    color: '#1a9991',
                    icon: '',
                },
                {
                    text: '仪器设备',
                    value: 10764,
                    color: '#426cb6',
                    icon: '',
                },
                {
                    text: '政策法规',
                    value: 1122,
                    color: '#f06c42',
                    icon: '',
                },
                {
                    text: '专利',
                    value: 10567,
                    color: '#1f3a93',
                    icon: '',
                },
                {
                    text: '软件著作权',
                    value: 10567,
                    color: '#9a59b5',
                    icon: '',
                },
                {
                    text: '标准',
                    value: 118,
                    color: '#1a9991',
                    icon: '',
                },
                {
                    text: '示范工程',
                    value: 10764,
                    color: '#426cb6',
                    icon: '',
                },
                {
                    text: '数据集',
                    value: 1122,
                    color: '#f06c42',
                    icon: '',
                },
            ],
        });
    },
    'GET /mockApi/types1': (req: Request, res: Response) => {
        const parent: string[] = [
            '生态环保',
            '灾害应急',
            '灾害应急',
            '城市管理',
            '农林监测',
            '资源普查',
            '遥感监测',
            '生态环保',
            '灾害应急',
        ];
        res.send({
            success: true,
            data: parent.map((item) => ({ name: item, children: Array(3).fill('二级分类') })),
        });
    },
    'GET /mockApi/types2': (req: Request, res: Response) => {
        const parent: string[] = [
            '数据获取',
            '数据传输',
            '装备制造',
            '数据处理',
            '技术运维',
            '数据处理',
            '技术应用',
            '装备制造',
        ];
        res.send({
            success: true,
            data: parent.map((item) => ({ name: item, children: Array(3).fill('二级分类') })),
        });
    },
    'GET /mockApi/getKnowledge': (req: Request, res: Response) => {
        res.send({
            success: true,
            data: Array(6).fill({
                title: '资源环境承载能力评价知识包',
                viewCount: 123,
                fileCount: 10,
                datetime: '2022-05-12',
            }),
        });
    },
};
